import React from 'react';
import { Pagination} from '@alifd/next';

import styles from './index.module.scss';
const Paginations= (props: any) => {
  // 分页监听
  const pageChange = (val: number) => {
    props.pageChange(val);
  }
  if (props.total) {
    return (
      <div className={styles.pagebox}>
        <Pagination
          total={props.total}
          current={props.pageNum}
          pageSize={props.pageSize ? props.pageSize : 20}
          onChange={pageChange} />
      </div>
    )
  }
  return null;
}
export default Paginations;
